package com.kfm.spring.controller;

import com.kfm.spring.model.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

@Controller
public class RequestController {

    @RequestMapping("/rbody")
    public String rbody(@RequestBody(required = false) String str){
        System.out.println(str);
        return "hello";
    }

    @RequestMapping(value = "/rbody2")
    public String rbody(@RequestBody(required = false) User user, HttpServletRequest request){
        System.out.println(request.getContentType());
        System.out.println(user);
        return "hello";
    }
}
